package com.polytech.dao.hibernate;

import java.util.List;

import org.hibernate.Query;

import com.polytech.beans.Brand;
import com.polytech.beans.Car;
import com.polytech.beans.Client;
import com.polytech.dao.ClientDao;

public class ClientDaoHibernate extends AbstractHibernateDao implements ClientDao {

	@Override
	public void insert(Client client) {
		beginTransaction();
			session.save(client);
		commit();
		
	}

	@Override
	public Client select(String key) {
		beginTransaction();
		 Client client=(Client)session.get(Client.class, key);
		commit();
		return client;
	}

	@Override
	public void remove(Client client) {
		beginTransaction();
			session.delete(client);
		commit();
	}

	@Override
	public void update(Client client) {
		beginTransaction();
		session.update(client);
		commit();
		
	}

	
}
